difference between calling a function and referencing a function python

28

def caller(f):
    f()

def hello():
    print("hi")

def goodbye():
    print("bye")

caller(hello)  # Prints "hi"
caller(goodbye)  # Prints "bye"

Comments

Submit
0 Comments